package project.menu.ordermenu.listdeletedorders;

import project.controllers.Controller;
import project.menu.IMenu;
import project.menu.IMenuItem;
import project.work.Navigator;
import controllers.IAutoservice;

public class DeletedOrdersByFillingDate implements IMenuItem {

	private String name = "Sort By FillingDate";
	private final Integer id = 1;
	private static IMenu submenu;	
	private Controller con;
	private Navigator n;
	
	public DeletedOrdersByFillingDate(){
		con=Controller.getInstance();
		n=Navigator.getInstance();
	}
	
	
	public Integer getId() {
		return id;
	}
	

	
	public String getNameItem() {
		return name;
	}

	public static void setMenu(IMenu menu) {
		submenu = menu;
	}
	
	public void action(IAutoservice aut) {
		//sort by filling date
		aut.SortDeletedOrderByPeriodByFillingDate(con.getBeginDate(),con.getEndDate());
		n.drawMenu(submenu);

	}
}
